var hidden = function () {
    console.log('android 没有注入')
}

import constant from './constant'

export default {
    callhandler (data, callback) {
        if (window.WebViewJavascriptBridge) {
            window.WebViewJavascriptBridge.callHandler(constant.call_handler_value, data, callback)
        } else {
            hidden()
        }
    },
    registerhandler (callback) {
        if (window.WebViewJavascriptBridge) {
            window.WebViewJavascriptBridge.registerHandler(constant.register_handler_value, function (data, responseCallback) {
                callback(data, responseCallback)
            })
        } else {
            hidden()
        }
      
    }
}